import { BaseVueNodeView, BaseVueNodeModel } from '../base-node.js';
import VueNode from './http.vue';

class VueHtmlNode extends BaseVueNodeView {
  constructor(props) {
    super(props);

    this.renderVue(VueNode, props);
  }
}
class VueHtmlNodeModel extends BaseVueNodeModel {
  setAttributes() {
    this.width = 340;
    this.height = 280;
  }
  getDefaultAnchor() {
      // 定义锚点位置
    const { id, x, y,height, width, isHovered, isSelected } = this
    const { nodeSortKey } = this.properties
    return [
      {
        x: x - width / 2,
        y: y - height / 2 + 25,
        id: nodeSortKey + '-anchor_left',
        type: 'left',
        isHovered,
        isSelected,
        id: id,
      },
        {
        x: x + width / 2,
         y: y - height / 2 + 25,
        id: id + '-anchor_right',
        type: 'right',
        isHovered,
        isSelected,
        id: id,
      },
    ]
  
  }
}
export default {
  type: 'http',
  model: VueHtmlNodeModel,
  view: VueHtmlNode
};
